# Sets the minimum version of CMake required to build your native library.
# This ensures that a certain set of CMake features is available to
# your build.

cmake_minimum_required(VERSION 3.4.1)

# Specifies a library name, specifies whether the library is STATIC or
# SHARED, and provides relative paths to the source code. You can
# define multiple libraries by adding multiple add.library() commands,
# and CMake builds them for you. When you build your app, Gradle
# automatically packages shared libraries with your APK.

#add_library( # Specifies the name of the library.
#             native-lib
#
#             # Sets the library as a shared library.
#             SHARED
#
#             # Provides a relative path to your source file(s).
#             src/main/cpp/native-lib.cpp )

#add_subdirectory(libavutil)
#add_subdirectory(libswresample)

#SET(OpenCV_DIR ../../../../../../libs/OpenCV-android-sdk/sdk/native/jni)

#include_directories(SYSTEM ../../../../../../libs/eigen)

add_library(jni_photoeditor
    SHARED
    utils.cpp
    backlight.cpp
    blur.cpp
    colortemp.cpp
    convolution.cpp
    copy.cpp
    crossprocess.cpp
    duotone.cpp
    fisheye.cpp
    flip.cpp
    grain.cpp
    grayscale.cpp
    heq.cpp
    negative.cpp
    quantize.cpp
    redeye.cpp
    saturate.cpp
    sepia.cpp
    sharpen.cpp
    tint.cpp
    vignetting.cpp
    warmify.cpp
    whiteblack.cpp)

find_library( # Defines the name of the path variable that stores the
              # location of the NDK library.
              log-lib

              # Specifies the name of the NDK library that
              # CMake needs to locate.
              log
              m
              )

find_library( jnigraphics-lib jnigraphics )
#find_package( OpenCV REQUIRED )

# Links your native library against one or more other native libraries.
target_link_libraries( # Specifies the target library.
                       jni_photoeditor
                       # Links the log library to the target library.
                       ${jnigraphics-lib} ${log-lib})
